<html>
	<head>
		<meta charset="UTF-8">
		<title>ckplayer</title>
		<link rel="stylesheet" type="text/css" href="${ctxPath!}/plugins/layui/css/layui.css" media="all"/>
		<script type="text/javascript" src="${ctxPath!}/plugins/layui/layui.js"></script>
		<script type="text/javascript" src="${ctxPath!}/plugins/jquery/jquery.min.js"></script>
		<script type="text/javascript" src="${ctxPath!}/plugins/ckplayer/ckplayer.js"></script>
		<style type="text/css">
		body{
			margin:0;
			padding:0px;
			font-family:"Microsoft YaHei",YaHei,"微软雅黑",SimHei,"黑体";
			font-size:14px;
			}
		#tool{
			position: absolute;
			top: 10px;
			right: 10px;
			/*width: 100%;*/
			/*height: 38px;*/
			z-index: 500;
			/*background: rgba(0,0,0,0.65);*/
		}
		</style>
	</head>
	<script type="text/javascript">
	layui.use(['element'], function () {
	var $ = layui.jquery;
	var videoId="${videoId!}";
	if (videoId==null){
         videoId="41010000001320000140%40016%240";
	}
	var url="http://10.4.234.183:7086/live/cameraid/"+videoId+"/substream/1.m3u8";
	var videoHeight = $(window).height();
	var returnTop="${ctxPath!}/stshipinb/player.html?videoId="+videoId;

	$(".video").height(videoHeight);

	$("#returnTop").bind("click",function (){
		window.open(returnTop,"_self");
	});
	
	var videoObject = {
		container: '.video',//“#”代表容器的ID，“.”或“”代表容器的class
		variable: 'player',//该属性必需设置，值等于下面的new chplayer()的对象
		autoplay:true,//自动播放
		live:true,
		loaded:'loadedHandler', //当播放器加载后执行的函数	
		video:url//视频地址
	};
	
	var player=new ckplayer(videoObject);

	function loadedHandler() {
		player.addListener('error', errorHandler); //监听元数据
	}
 
	function errorHandler(e) {
		//出错了
		alert("");
		console.log(e);
	}

	//获取url地址参数的方法
    function GetQueryString(param){
		var reg = new RegExp("(^|&)"+ param +"=([^&]*)(&|$)");
		var r = window.location.search.substr(1).match(reg);
		if(r!=null)return  unescape(r[2]); return null;
	}

	});
	</script>
	<body>
		<div id="tool"><button id="returnTop" class="layui-btn" ><i class="layui-icon layui-icon-return"></i>返回上一级</button></div>
		<div class="video" style="width: 100%;height: 500px"></div>
	</body>
</html>